package com.example.myDesignPatterns.创建者模式.原型模式.深克隆.assembly;


import com.example.myDesignPatterns.创建者模式.原型模式.深克隆.bean.Student;
import lombok.Data;

@Data
public class Citation implements Cloneable {
    private Student stu;

    @Override
    public Object clone() throws CloneNotSupportedException {
        Citation citationCopy = (Citation) super.clone();
        citationCopy.stu = (Student) stu.clone();
        return citationCopy;
    }

    // 用于输出展示
    public void show() {
        System.out.println("Citation with student: " + stu);
    }
}
